


#delimit;
set more off;

cd "C....Replication files";
	
use "ENMI - replication.dta", clear;

/* Table A1 -  Fixed Effects Rob checks	*/
/* using ENMI based on Herfindahl entropy	*/


/* ENMI from Herfindahl */

xtreg pvote
	c.enmi##i.inc_cab_l pvote_l ,
 fe robust;

 estimate store herf_enmi_simple;
 
xtreg pvote
	c.enmi##i.inc_cab_l pvote_l
	c.GDPgrowth##i.inc_cab_l
	c.moderate##i.inc_cab_l

	1.nparty
 majelect federal directpres ,
 fe robust;
		
		 estimates store herf_enmi_full;	
		 
		 xtreg pvote
	c.enmi
	pvote_l
	c.GDPgrowth
	c.moderate

	1.nparty
 majelect federal directpres if inc_cab_l==0,
 fe robust;
		
		 estimates store herf_enmi_opponly;	
	
	
	xtreg pvote
	c.enmi#i.inc_cab_l
 pvote_l
	c.GDPgrowth#i.inc_cab_l
	c.moderate#i.inc_cab_l

	1.nparty
 majelect federal directpres if inc_cab_l==1,
 fe robust;
		
		 estimates store herf_enmi_incumbentonly;	
		 
		 
	 #delimit;
 esttab  herf_enmi_opponly herf_enmi_incumbentonly herf_enmi_full 
 using "figures\TableA1 - herfindahl_enmi.rtf", replace 
		b (%10.3f) se scalars("aic AIC" "bic BIC" "rmse Root Mean Squared Error" "ll Log-Likelihood" ) 
		obslast star(+ 0.10 * 0.05 ** 0.01 *** 0.001)
		label mtitles ( "Opposition" "Incumbents" "Full") nogaps
		title (\label{})
order(enmi 
1.inc_cab_l#c.enmi
moderate 
1.inc_cab_l#c.moderate
GDPgrowth
1.inc_cab_l#c.GDPgrowth 
1.inc_cab_l 

 majelect pvote_l _cons ) 

keep(enmi 1.inc_cab_l 
1.inc_cab_l#c.enmi GDPgrowth 
1.inc_cab_l#c.GDPgrowth 
1.inc_cab_l#c.moderate
moderate majelect 
pvote_l _cons )  

 coeflabels(
enmi "ENMI(Herfindahl)" 
1.inc_cab_l "Incumbent"
1.inc_cab_l#c.enmi "Incumbent X ENMI(Herfindahl)"
GDPgrowth "GDP Growth Rate" 
1.inc_cab_l#c.GDPgrowth "Incumbent X GDP Growth Rate"
1.inc_cab_l#c.moderate "Incumbent X Moderated Position"
moderate "Moderated Position"
majelect "Majoritarian Election"
pvote_l "% Vote{\sub t-1}"
_cons "Constant")
addnotes("Note: The Dependent variable is percentage vote for the party.");






	
/* Table A2 -  Fixed Effects Rob checks	*/
/* using logged ENMI	*/

	
gen ln_ensh_mi= ln(ensh_mi);


	
set more off;
xtreg pvote
	c.ln_ensh_mi##i.inc_cab_l pvote_l ,
 fe robust;

 estimate store lnENMI_simple;
 
xtreg pvote
	c.ln_ensh_mi##i.inc_cab_l pvote_l
	c.GDPgrowth##i.inc_cab_l
	c.moderate##i.inc_cab_l

	1.nparty
 majelect federal directpres ,
 fe robust;
		
		 estimates store lnENMI_full;	
		 
		 
		 xtreg pvote
	c.ln_ensh_mi pvote_l
	c.GDPgrowth
	c.moderate

	1.nparty
 majelect federal directpres if inc_cab_l==0,
 fe robust;
		
		 estimates store lnENMI_opponly;	
	
	
	xtreg pvote
	c.ln_ensh_mi#i.inc_cab_l pvote_l
	c.GDPgrowth#i.inc_cab_l
	c.moderate#i.inc_cab_l

	1.nparty
 majelect federal directpres if inc_cab_l==1,
 fe robust;
		
		 estimates store lnENMI_incumbentonly;	
	

	 #delimit;
 esttab  lnENMI_opponly lnENMI_incumbentonly lnENMI_full 
 using "figures\TableA2 - ln_enmi.rtf", replace 
		b (%10.3f) se scalars("aic AIC" "bic BIC" "rmse Root Mean Squared Error" "ll Log-Likelihood" ) 
		obslast star(+ 0.10 * 0.05 ** 0.01 *** 0.001)
		label mtitles ( "Opposition" "Incumbents" "Full") nogaps
		title (\label{})
order(ln_ensh_mi 
1.inc_cab_l#c.ln_ensh_mi 
moderate 
1.inc_cab_l#c.moderate
GDPgrowth
1.inc_cab_l#c.GDPgrowth 
1.inc_cab_l 

 majelect pvote_l _cons ) 

keep(ln_ensh_mi 1.inc_cab_l 
1.inc_cab_l#c.ln_ensh_mi GDPgrowth 
1.inc_cab_l#c.GDPgrowth 
1.inc_cab_l#c.moderate
moderate majelect 
pvote_l _cons )  

 coeflabels(
ln_ensh_mi "ln(ENMI)" 
1.inc_cab_l "Incumbent"
1.inc_cab_l#c.ln_ensh_mi "Incumbent X ln(ENMI)"
GDPgrowth "GDP Growth Rate" 
1.inc_cab_l#c.GDPgrowth "Incumbent X GDP Growth Rate"
1.inc_cab_l#c.moderate "Incumbent X Moderated Position"
moderate "Moderated Position"
majelect "Majoritarian Election"
pvote_l "% Vote{\sub t-1}"
_cons "Constant")
addnotes("Note: The Dependent variable is percentage vote for the party.");



/* Squared ENMI	*/
xtreg pvote
	c.ensh_mi##c.ensh_mi##i.inc_cab_l pvote_l ,
 fe robust;

 estimate store lnENMI_simple;
 
xtreg pvote
	c.ensh_mi##c.ensh_mi##i.inc_cab_l pvote_l
	c.GDPgrowth##i.inc_cab_l
	c.moderate##i.inc_cab_l

	1.nparty
 majelect federal directpres ,
 fe robust;
		
		 estimates store sqrENMI_full;	
		 
		 xtreg pvote
	c.ensh_mi##c.ensh_mi pvote_l
	c.GDPgrowth
	c.moderate

	1.nparty
 majelect federal directpres if inc_cab_l==0,
 fe robust;
		
		 estimates store sqrENMI_opponly;	
	
	
	xtreg pvote
	c.ensh_mi#i.inc_cab_l
	c.ensh_mi#c.ensh_mi#i.inc_cab_l pvote_l
	c.GDPgrowth#i.inc_cab_l
	c.moderate#i.inc_cab_l

	1.nparty
 majelect federal directpres if inc_cab_l==1,
 fe robust;
		
		 estimates store sqrENMI_incumbentonly;	
		 

